﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using DAL;
using IBLL;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Model;

namespace MedicalSystem.Controllers
{
    public class OutcallController : Controller
    {
        public IActionResult OutcallList()
        {
            return View();
        }
        public IActionResult AddOutcall()
        {
            return View();
        }
        public IActionResult OutcallDetail()
        {
            return View();
        }
        private readonly ILogger<OutcallController> _logger;
        IOutcallBLL _bll;
        public OutcallController(ILogger<OutcallController> logger, IOutcallBLL bll)
        {
            _logger = logger;
            _bll = bll;
        }
        /// <summary>
        /// 获得出诊信息
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public List<ShowOutcallview> GetOutcall()
        {
            return _bll.GetOutcalls();
        }
        /// <summary>
        /// 出诊详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public JsonResult GetOutcallById(int id)
        {
            return Json(_bll.GetOutcallsById(id));
        }
    }
}
